package com.woniuxy.dao.impl;

import com.woniuxy.dao.ManagerDao;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

import java.util.Map;
import java.util.Set;

public class ManagerDaoImpl implements ManagerDao {
    private SqlSessionFactory sqlSessionFactory;

    public SqlSessionFactory getSqlSessionFactory() {
        return sqlSessionFactory;
    }

    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        this.sqlSessionFactory = sqlSessionFactory;
    }

    public Map getByid(int id) {
        System.out.println(sqlSessionFactory);
        SqlSession sqlSession = sqlSessionFactory.openSession();
        ManagerDao mapper = sqlSession.getMapper(ManagerDao.class);
        System.out.println(mapper);
        Map<String, String> byid = mapper.getByid(id);
        return byid;
    }
}
